package com.ks.core.api;

import com.ks.core.anno.MustEq;
import com.ks.core.api.config.ApiConfig;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author kingdee
 */
@Data
public class ApiRequest implements Serializable {
    @NotEmpty(message = "appKey不能为空")
    private String appKey;

    @NotEmpty(message = "requestid不能为空")
    @Size(min = 32, max = 32, message = "requestid需要为32位")
    private String requestid;

    @NotEmpty(message = "timestamp不能为空")
    private String timestamp;

    @MustEq(value = ApiConfig.VERSION, message = "version必须为1.0")
    private String version;

    @MustEq(value = ApiConfig.SIGN_METHOD, message = "signmethod必须为MD5")
    private String signmethod;

    @MustEq(value = ApiConfig.FORMAT, message = "format必须为json")
    private String format;

    @NotEmpty(message = "bizcontent不能为空")
    private String bizcontent;

    @NotEmpty(message = "sign不能为空")
    private String sign;
}
